Skip to content

Fix moshi-server running twice after shutdown - #109

Open
Mar-IA-no wants to merge 1 commit into
NVIDIA:mainfrom
Mar-IA-no:fix/server-entrypoint-double-run
Open

Fix moshi-server running twice after shutdown#109
Mar-IA-no wants to merge 1 commit into
NVIDIA:mainfrom
Mar-IA-no:fix/server-entrypoint-double-run

Conversation

@Mar-IA-no

@Mar-IA-no Mar-IA-no commented Sep 7, 2026

Copy link
Copy Markdown

moshi-server points to moshi.server:main, while importing that module also calls main(). After the first server stops, the console entry point calls it again and reloads the model; on an RTX 3090 this ended in CUDA OOM.

This change keeps torch.no_grad() on both launch paths and only runs main() at module scope for python -m moshi.server.

Verified by importing the module without side effects, launching both CLI paths, and completing a GPU shutdown smoke without a second model load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant